#pragma once
#include "singleton.h"

class IGameStateBase
{
public:
    virtual void Reset() = 0;
    virtual void DoAction() = 0;
public:
    DWORD   Index;
    bool    bGo;
    CString Name;
    DWORD m_dwGCDtime;
    DWORD m_dwDoorCount;
};
class CGameAnalyze;
class CGameStateMgr:public Singleton<CGameStateMgr>
{
    friend class CGameAnalyze;

    static bool GameStateSort(IGameStateBase*& A, IGameStateBase*&B)
    {
        return A->Index < B->Index;
    }
private:
    typedef std::vector<IGameStateBase*>    VecGameState;
    typedef std::map<CString, bool>         MapGameState;
    VecGameState        m_GameState;
    MapGameState        m_RunState;
    CString             m_AyrTrace[4];
    IGameStateBase      *pCur, *pLast;
public:
    CGameStateMgr();
    ~CGameStateMgr(){}
    //static CGameStateMgr& Instance()
    //{
    //    static CGameStateMgr T;
    //    return T;
    //}
    bool Init();
    bool Run();
    bool Destory();
    
};